/**
 * Created by Administrator on 2021/3/25.
 */
layui.use(['form','layer'], function(){
    var form = layui.form,
        layer = layui.layer,
        $=layui.$;

    //提交审核通过
    form.on("submit(formDemo)",function(data){
        //弹出loading
        var index =layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
        // 实际使用时的提交信息
        $.post(config.gatewayUri+"/"+config.goodsServiceId+"/api/device-cabinet/admin/setIsStock",{
            cabinetid : $("#cabinetid").val(),
            stockqty : $("#stockqty").val()
        },function(res){
            layer.alert(res.msg);
        });
        setTimeout(function(){
            layer.close(index);
            layer.msg("审核成功！");
            //刷新父页面
            parent.location.reload();
        },500);
        return false;
    });
});